-
Notifications
You must be signed in to change notification settings - Fork 178
Move to SDL3 #6735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Move to SDL3 #6735
Conversation
|
All existing features should be in working order now, though only limited testing was done to confirm that. Additional tweaks are likely. The main exception is setting of gamma, which has been removed from SDL3. This will need to be handled by shaders instead. Look for This PR will also see bigger refactors to make use of SDL3's new audio and filesystem code. Proper gamepad support and working multi voice chat are also likely. Those changes should be self-contained feature commits which may eventually be split into separate PRs or just dropped entirely. WARNING: This PR will be rebased, squashed, and reordered many times before it's done. So if you follow it locally then please plan accordingly. |
a4c9284 to
1ef7a70
Compare
c26cce4 to
9d881b6
Compare
9d881b6 to
5dddda3
Compare
|
Regarding audio changes, the SDL3 audio system will be used everywhere. OpenAL is still used for sound effects, but only for mixing, with the result being fed to SDL3 for actual playback. That feature requires the loopback device extension from openal-soft and will fall back to regular physical device access if it's not available. Aside from the init changes there is no real change necessary to normal OpenAL code. That allows further work to the OpenAL code to be done without having to really know about the SDL3 stuff. And since sound effects are the only bit of code using OpenAL, it's now possible to use all of Note that flags and config info are unchanged to preserve max compatibility with older builds. Choosing a specific playback/recording device in settings or via the launcher will work like it always has, yet will have no effect with this new code. The physical device fallback code could be removed if we start requiring openal-soft as opposed to it being optional. openal-soft is distributed with all official builds and our prebuilt version is already required for Windows and Mac builds. It's only optional for Linux builds, however nearly all distros distribute openal-soft as their only openal version. There are two main benefits to this new setup: 1) the SDL3 audio code is much simpler, and 2) when the default audio device changes it will switch automatically. The first allows for much cleaner and easier to understand code if no special mixing is required. Movies, audio streaming, and audio capture do not require 2D/3D positioning effects, so using OpenAL for them is overkill. The second means that if you are playing FSO and audio is coming out of your computer speakers, but then you turn on/plug in some headphones, the audio will switch to the new device automatically. This also means that selecting a specific device to use generally isn't required as SDL3 will automatically switch to whatever device is considered default at the OS level. It should all just work in other words, without any special configuration or interaction by the user. At the moment EFX/EAX effects via the Voice capture is also not complete. The code has been rewritten to use SDL3 instead of OpenAL, however it remains unusable as there is no compression codec in place to allow it to work with multi. Once that issue has been sorted out the changes will be submitted. |
248090b to
eed4643
Compare
4ac1a50 to
8297407
Compare
573ad7a to
6d920fd
Compare
df47b26 to
f31f2f1
Compare
f31f2f1 to
6dc94fc
Compare
8b44648 to
ff31bec
Compare
ff31bec to
a37a6c5
Compare
|
The commit got squashed down at some point, but this does partially address #4748. Specifically, it only enables textinput when a retail ui inputbox has focus, and disables textinput when it loses focus, which is proper usage. ImGui also uses it appropriately. We still need to verify that rocketui enables it only while an input field has focus, and that the input fields lose focus when the debug console becomes active. Confirming that, or making changes to that affect, should fully resolve the issue. |
7265c9d to
839f4c4
Compare
b2cf4fe to
6c37993
Compare
6c37993 to
511c649
Compare
Also updates imgui and related addons to newest versions
Continue using OpenAL for mixing, but feed the result to SDL3 for playback rather than having OpenAL with the physical audio device. Outside of the minor init changes OpenAL can be used as normal. Bug fix: when querying the default playback device openal-soft will always return "OpenAL Soft". So instead use the all_device_specifier if supported (which it will be in this case) to get the proper default device name.
- replace a lot of platform specific code with SDL filesystem functions - remove support for memory-mapped files (not actually used) - only do special case-sensitive filesystem handling if required - support case-sensitive roots on Windows
Additionally sets in-game FF options to use the same defaults as the old osreg calls and makes changes take immediate effect (no restart required). FF strength slider changed from float to integer type.
Allots special buttons for use by gamepad triggers. This allows triggers to be usable as an axis or a button depending on the control type. NOTE: This is implemented in a way that shouldn't break compatiblity with other builds using the same cc profile. It does not use the control config code that appears to allow for axis buttons due to it not being fully implemented and needing too much work for sort out. Should that ever happen this feature should be revisited so that it can be implemented properly.
- generate appimage for qtfred if it's available - separate fso and qtfred install roots - move fso appimage files out of global space - fix qtfred appimage launch script - prefer X11 Qt backend for qtfred
Fix issue setting path cmake variables in the gui due to the incorrect type being specified.
46ae64f to
8151608
Compare
Clang treats -Og the same as -O1, which prevents the viewing of many variables while debugging, so we need to use -O0 directly.
8151608 to
7e9e74d
Compare
Use a callback for SDL3 to request more audio data instead of using a timer to push audio data. Helps prevent issue with stall recovery when program execution temporarily halts (like when debugging).
7e9e74d to
98625c8
Compare
Make the move from SDL2 to SDL3 along with fixes and improvements made along the way. (long-term draft PR)